package subject_set.offer100;

/**
 * @author haomin
 * @date 2022/10/13 21:17
 **/
public class Offer10 {
    class Solution {
        public int fib(int n) {
            if(n < 2) return n;
            int a = 0, b = 1;
            for(int i = 2; i <= n; ++i){
                int c = (a + b) % 1000000007;
                a = b; b = c;
            }
            return b;
        }
    }
}